function [y, ny] = convu(h, nh, x, nx)
    % Ensure nh and nx are vectors of indices
    nh = nh(1):nh(end);  % Define nh as a range of indices
    nx = nx(1):nx(end);  % Define nx as a range of indices
    % Calculate the start and end indices for the convolution result
    nys = nh(1) + nx(1);
    nyf = nh(end) + nx(end);
    % Perform convolution
    y = conv(h, x);
    % Define output indices
    ny = nys:nyf;
end
